package com.dogegg.lbbopenapi.request;

import com.dogegg.lbbopenapi.OpenapiRegisteredClient;
import jakarta.validation.constraints.NotEmpty;

import java.util.HashMap;
import java.util.Map;

public  class OpenRequest {

    @NotEmpty
    protected String requestId;
    @NotEmpty
    protected String timestamp;
    @NotEmpty
    protected String clientId;
    @NotEmpty
    protected String signature;

    protected OpenapiRegisteredClient client;

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public OpenapiRegisteredClient getClient() {
        return client;
    }

    public void setClient(OpenapiRegisteredClient client) {
        this.client = client;
    }

   final public Map<String, Object> getSignMap() {
        Map<String,Object> map = new HashMap<>();
        map.putAll(getSignField());
        map.put("requestId",requestId);
        map.put("timestamp",timestamp);
        map.put("clientId",clientId);
        return map;
    }

    public Map<String, String> getSignField(){
        return Map.of();
    }

    public void validate() {

    }

    @Override
    public String toString() {
        return "OpenRequest{" +
                "requestId='" + requestId + '\'' +
                ", timestamp='" + timestamp + '\'' +
                ", clientId='" + clientId + '\'' +
                ", signature='" + signature + '\'' +
                '}';
    }



}
